/**
 * Jefferson Amado Peña Torres
 * 21-Nov-010
 */
function errordAcceso(){
    alert(document.getElementById('accesoForm:btAceptar'));
}
function changeSelect(selectobj){
 document.getElementById('image').src="images/sofia/"+selectobj.selectedIndex+".jpg";
}
function cambiaGenero(selectobj){
 document.getElementById('imagenGenero').src="images/index/"+selectobj.value+".png";
}
function mostrarPnPaciente(){
        document.getElementById("atContenidoDefault").setAttribute("class", "hidebyDefault");
        document.getElementById("atContenidoCita").setAttribute("class", "hidebyDefault");
        document.getElementById("atContenidoPaciente").setAttribute("class", "showPanel");
        document.getElementById('imagenGenero').src="images/index/Default.png";
}
function mostrarPnCita(){
        document.getElementById("atContenidoDefault").setAttribute("class", "hidebyDefault");
        document.getElementById("atContenidoPaciente").setAttribute("class", "hidebyDefault");
        document.getElementById("atContenidoCita").setAttribute("class", "showPanel");
        document.getElementById('imagenGenero').src="images/index/programador.png";
}
function mostrarPnlistaPacientes(){
        document.getElementById("atContenidoCita").setAttribute("class", "hidebyDefault");
        document.getElementById("atContenidoPaciente").setAttribute("class", "hidebyDefault");
        document.getElementById("atContenidoDefault").setAttribute("class", "showPanel");
        document.getElementById('imagenGenero').src="images/index/Default.png";
}
function sendmessage1()
			{
			alert("sendmessage1....functiion called");
				var message=document.getElementById("txtmessage").value;
				xmlHttp5=GetXmlHttpObject();
				alert('chat message......'+message);
				alert('chatid...'+id1);
				alert("xmlHttp5..."+xmlHttp5);
				//var url = "savechatmessage.jsp";
				//var url="savechatmessage.jsp?myid=+id1&emailmessag1="+message;
				//var url ="savechatmessage.jsp?emailmessag1=+message&myid="+id1;
				var url="savechatmessage.jsp?emailmessag1="+message+"&myid="+id1;
				var params = "email="+id1+"&emailmessage1="+message;
				alert('url...'+url);
				alert('params...'+params);
				xmlHttp5.open("POST",url,true);
				xmlHttp5.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				xmlHttp5.setRequestHeader("Content-length", params.length);
				xmlHttp5.setRequestHeader("Connection", "close");
				xmlHttp5.onreadystatechange = stateChangedValue;
				xmlHttp5.send(params);
			}

function stateChangedValue()
{
alert('stateChangeValue function called...');
if(xmlHttp5.readyState == 4 && xmlHttp5.status == 200)
{
//alert(xmlHttp5.responseText);
xmlDoc=xmlHttp5.responseXML;
alert('xmDoc...'+xmlDoc);
document.getElementById("chatmessagediv").innerHTML +=""+name11+":"+"     "+xmlDoc.getElementsByTagName("text")[0].childNodes[0].nodeValue;
alert(document.getElementById("chatmessagediv").innerHTML +=""+name11+":"+"     "+xmlDoc.getElementsByTagName("text")[0].childNodes[0].nodeValue);

document.getElementById("txtmessage").value="";
alert(document.getElementById("txtmessage").value="");
}
if(xmlHttp5.readyState == 4 && xmlHttp5.status != 200)
alert("connected failed");
}